#!/usr/bin/env node

const fs  = require('fs'),
      fileName = process.argv[2] || __filename,
      log = console.log;

//let num = 1;
try{
  //打印行号
  //fs.readFileSync(fileName).toString('utf8').split('\n').forEach((line)=>{
  //  log(`${num++}\t${line}`)
  //})
  let arr = fs.readFileSync(fileName).toString('utf-8').split('\n');
  for(let i=0;i<arr.length;i++){
    log(`${i+1}\t${arr[i]}`);
  }
}catch(e){
  log(e.message);
  process.exit(1);
}


